<%--
  Created by IntelliJ IDEA.
  User: 86137
  Date: 2021/11/1
  Time: 10:29
  To change this template use File | Settings | File Templates.
--%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta name="viewport" content="width-device-width, initial-scale=1.0">
    <link rel="stylesheet" href="resource/css/bootstrap.css">
    <script type="text/javascript" src="resource/js/jquery-3.2.1.js"></script>
    <script type="text/javascript" src="resource/js/bootstrap.js"></script>
    <title>Title</title>
</head>
<body>
    <form:form modelAttribute="accountant" action="add" method="post">
        <table class="table">
            <tr>
                <td>有效期</td>
                <td>
                    <form:input path="dates" type="date"></form:input>
                </td>
            </tr>
            <tr>
                <td>姓名</td>
                <td>
                    <form:input path="name"></form:input>
                </td>
            </tr>
            <tr>
                <td>省市</td>
                <td>
                    <form:input path="city"></form:input>
                </td>
            </tr>
            <tr>
                <td>性别</td>
                <td>
                    <form:select path="gender">
                        <form:option value="">===请选择===</form:option>
                        <form:option value="男">男</form:option>
                        <form:option value="女">女</form:option>
                    </form:select>
                </td>
            </tr>
            <tr>
                <td>申请注册单位</td>
                <td>
                    <form:input path="unit"></form:input>
                </td>
            </tr>
            <tr>
                <td>职业资格证书编号</td>
                <td>
                    <form:input path="serialNum"></form:input>
                </td>
            </tr>
            <tr>
                <td>会计师分类</td>
                <td>
                    <select name="aid">
                        <option value="">===请选择===</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td>注册号</td>
                <td>
                    <form:input path="registerNum"></form:input>
                </td>
            </tr>
            <tr>
                <td colspan="22">
                    <form:button class="btn btn-warning">提交</form:button>
                </td>
            </tr>
        </table>
    </form:form>

    <script type="text/javascript">
        $(function (){
            $.post(
                "selectTypes",
                function (msg){
                    var str = "<option value=''>===请选择===</option>";
                    for (var i = 0; i < msg.length; i++) {
                        str += "<option value='"+msg[i].id+"'>"+msg[i].name+"</option>";
                    }
                    $("[name='aid']").html(str);
                }
            )
        })
    </script>
</body>
</html>
